import sytRequest from './../request/syt';

// 分页列表  第三个参数 params  搜索用到的参数
export const getHospitalSet = (page: number, limit: number,params:any={}) => (
  sytRequest.get(`/admin/hosp/hospitalSet/${page}/${limit}`,{
    params
  })
)

// 锁定
export const getHospitalSetLockId = (id: number, status: number) => {
  // 改变status状态 实现 点击切换功能
  status = status === 0 ? 1 : 0
  return sytRequest.get(`/admin/hosp/hospitalSet/lock/${id}/${status}`)
}

// 新增医院设置
export const postHospitalSet = (body: any) => (
  sytRequest.post('/admin/hosp/hospitalSet/save', body)
)


// 修改医院  /admin/hosp/hospitalSet/update
export const putHospitalSet = (body: any) => (
  sytRequest.put(`/admin/hosp/hospitalSet/update`, body)
)

// 根据id删除医院
export const deleteHospitalSetById = (id: number) => (
  sytRequest.delete(`/admin/hosp/hospitalSet/remove/${id}`)
)

// 根据id列表删除数据
export const deleteBatchMove = (data: React.Key[]) => {
  return sytRequest.delete(`/admin/hosp/hospitalSet/batchRemove`, {
    data
  })
}



// 获取医院详情
export const getHospitalshowId = (id:number) =>(
  sytRequest.get(`/admin/hosp/hospital/show/${id}`)
)

 
// 获取医院列表  分页列表也在这里做 搜索功能用到第三个参数 用的都是一个接口
export const getHospitalLList = (page:number,limit:number,params:any={}) =>(
  sytRequest.get(`/admin/hosp/hospital/${page}/${limit}`,{
    params
  })
)


// 医院是否上线
export const getUpdateStatus = (id:number,status:number)=>(
  sytRequest.get(`/admin/hosp/hospital/updateStatus/${id}/${status}`)
)

// 获取医院详情
export const getHospitalById = function(id:string){
  return sytRequest.get(`/admin/hosp/hospital/show/${id}`)
}

// 科室列表 
export const getDepartmentByHoscode = (hoscode:string)=>(
  sytRequest.get(`/admin/hosp/department/${hoscode}`)
)



// 渲染排班列表
export const getScheduleRule = (page:number,limit:number,hoscode:string,depcode:string)=>{
  return sytRequest.get(`/admin/hosp/schedule/getScheduleRule/${page}/${limit}/${hoscode}/${depcode}`)
}


// 排版详情 GET /admin/hosp/schedule/findScheduleList/{hoscode}/{depcode}/{workDate}
export const getFindScheduleList = (hoscode:string,depcode:string,workDate:string) => (
  sytRequest.get(`/admin/hosp/schedule/findScheduleList/${hoscode}/${depcode}/${workDate}`)
)


